﻿using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using wsRK.BaseObject;
using wsRK.BusinessObjectHelper;

namespace nkstdgia.common.DuongKhaoSat
{
    public class DuongKhaoSatDataService : BaseDataService
    {
        #region Constructor

        public DuongKhaoSatDataService()
        {
        }

        #endregion Constructor

        public List<TenDuongKhaoSatInfo> searchDuong(int QUANID, int PHUONGID)
        {
            return CBO.FillCollection<TenDuongKhaoSatInfo>((IDataReader)SqlHelper.ExecuteReader(
                this.strConnectring,
                CommandType.StoredProcedure,
                "sproc_DUONG_KHAO_SAT_searchDuong",
                new SqlParameter("@QUANID", QUANID),
                 new SqlParameter("@PHUONGID", PHUONGID)
                 ));
        }

        public List<DuongKhaoSatInfo> searchDoanDuong(int QUANID, int PHUONGID)
        {
            return CBO.FillCollection<DuongKhaoSatInfo>((IDataReader)SqlHelper.ExecuteReader(
                this.strConnectring,
                CommandType.StoredProcedure,
                "sproc_DUONG_KHAO_SAT_searchDoanDuong",
                new SqlParameter("@QUANID", QUANID),
                 new SqlParameter("@PHUONGID", PHUONGID)
                 ));
        }

        public List<DuongKhaoSatInfo> searchDuong4GiaDat(int QUANID)
        {
            return CBO.FillCollection<DuongKhaoSatInfo>((IDataReader)SqlHelper.ExecuteReader(
                this.strConnectring,
                CommandType.StoredProcedure,
                "sproc_DUONG_KHAO_SAT_Get",
                new SqlParameter("@QUANID", QUANID)
                 ));
        }

        //public List<DuongKhaoSatInfo> searchGiaDat4DoanDuong(int QUANID,string strDuong)
        //{
        //    return CBO.FillCollection<DuongKhaoSatInfo>((IDataReader)SqlHelper.ExecuteReader(
        //        this.strConnectring,
        //        CommandType.StoredProcedure,
        //        "sproc_DUONG_KHAO_SAT_searchGiaDat4DoanDuong",
        //        new SqlParameter("@QUANID", QUANID),
        //        new SqlParameter("@DUONG", strDuong)
        //         ));
        //}

        public List<DuongKhaoSatInfo> searchDuong4GiaDat()
        {
            return CBO.FillCollection<DuongKhaoSatInfo>((IDataReader)SqlHelper.ExecuteReader(
                this.strConnectring,
                CommandType.StoredProcedure,
                "sproc_DUONG_KHAO_SAT_Get4Export"
                 ));
        }
    }
}
